package com.ifly.task.selector.impl;

import com.ifly.task.repository.TypeRepository;
import com.ifly.task.selector.ExcelDynamicSelect;
import com.ifly.task.util.SpringContextUtil;

import java.util.List;

/**
 * @program: mypro
 * @description: todo
 * @author: xuYao2
 * @create: 2022-07-22 14:04
 **/
public class TypeSelector implements ExcelDynamicSelect {
    @Override
    public String[] getSource() {
        TypeRepository repository = SpringContextUtil.getBean(TypeRepository.class);
        List<String> allType = repository.findAllType();
        String[] strings = allType.toArray(new String[0]);
        return strings;
    }
}
